#include "apiservice.h"
#include <QTcpServer>
#include <QRandomGenerator>
ApiService::ApiService(QObject *parent) :
    QThread{parent}
{
}

ApiService::~ApiService()
{
}

QString ApiService::getBaseUrl()
{
    return QString("http://120.79.93.127:9999");
}

int ApiService::getRandomFreePort()
{
    QTcpServer server;
    server.listen(QHostAddress::Any, 0);     // 绑定到任意地址的随机端口
    int port = server.serverPort();
    server.close();
    return port;
}

void ApiService::run()
{
}
